<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function checkAll(o){
				var goods = document.getElementsByName("good");
				
				for(i in goods){
					goods[i].checked = o.checked;
				}
			}
		</script>
	</head>
	<body>
		<table border="1" width="200">
			<tr>
					<td>
					<input type="checkbox" onchange="checkAll(this)">全选
					</td>
					<td>
					商品名称
					</td>
			<tr>
					<td>
					<input type="checkbox" name="good">
					</td>
					<td>
					手机
					</td>
				</tr>
				<tr>
					<td>
						<input type="checkbox" name="good">
					</td>
					<td>
						笔记本电脑
					</td>
				</tr>
				<tr>
					<td>
						<input type="checkbox" name="good">
					</td>
					<td>
						pid
					</td>
			</tr>
		</table>
	</body>
</html>
